package googleJam.problem;

public abstract class CaseTest {
	protected int _caseIndex;
	protected String _ouputString;
	
	protected int _beginIndex;
	protected String _beginLine;
	protected int _lineNumber;

	public CaseTest(String beginLine,int index, int beginIndex) {
		_beginLine = beginLine;
		_caseIndex = index;
		_beginIndex = beginIndex;
		_lineNumber = calculLineNumber();
	}
	
	public void printResult()
	{
		Problem.getSharedInstance().getStringBuilder().append("Case #"+_caseIndex+": " + getResult()+"\n");
	}
	
	public abstract void trait (String line, int index);

	public int getNumberLine() {
		if(_lineNumber <= 0)
		{
			_lineNumber = calculLineNumber();
		}
		return _lineNumber;
	}
	
	public int getBeginIndex() { return _beginIndex; }
	
	public abstract int getEndIndex();
	
	public abstract int calculLineNumber();
	
	public int getIndex() { return _caseIndex; }
	public abstract String getResult();
}
